<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	<style type="text/css">
		*{
			padding: 0;
			margin: 0;
		}
		#box{
		width: 702px;
		height: 378px;
		background: url(img/flash_sale.png);
		margin: 0 auto;	
		/*position: absolute;*/
		}
		#box div{
			width: 50px;
			height: 50px;
			border: 1px solid gray;
			display: inline-block;
			position: relative;
			top: 260px;
			left: 300px;
			margin-left: 10px;
		 text-align: center;
		 line-height: 50px;
		}
	</style>
	</head>
	<body>
		<div id="box">
			<div id="day"></div>
			<div id="hour"></div>
			<div id="minute"></div>
			<div id="second"></div>
		</div>
		<script type="text/javascript">
			var now=new Date();
			var endSeconds=now.getTime()+24*60*60*2*1000;
			function seckill(){
				var nowtime=new Date;
				var remain=(endSeconds-nowtime.getTime())/1000;
				if(remain>0){}
			var day=parseInt(remain/(60*24*60));
			var hour=parseInt(remain/(60*60)%24);
			var minute=parseInt((remain/60)%60);
			var second=parseInt(remain%60);}
			else{
				clearInterval(timer);
				day=hour=minute=second=0;
			}
			day=(day<10?'0'+day:day);
			hour=hour<10?'0'+hour:hour;
			minute=minute<10?'0'+minute:minute;
			second=second<10?'0'+second:second;
			document.getElementById('day').innerHTML=day+'天';
			document.getElementById('hour').innerHTML=hour+'时';
			document.getElementById('minute').innerHTML=minute+'分';
			document.getElementById('second').innerHTML=second+'秒';
			}
			window.setInterval(seckill,1000)
		</script>
	</body>
</html>
